package ycl.common.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;
import ycl.common.enums.RedisEnum;
import ycl.common.properties.RedisProperties;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;


/**
 * 设想:
 * 批量创建多个 StringRedisTemplate
 * 从配置里获取配置的 StringRedisTemplate, 创建对应的 Bean
 * 从 map 中根据名字获取对应的 StringRedisTemplate
 */
@Configuration
@Deprecated
public class RedisConfig2 {


	@Resource
	private RedisProperties redisProperties;
	private final Map<String, StringRedisTemplate> stringRedisTemplate = new HashMap<>();

//	@Bean
	public StringRedisTemplate getStringRedisTemplate() {
		Set<RedisEnum> redisConfig = redisProperties.getRedisConfig();
		if (redisConfig.isEmpty()) {
			return null;
		}
		return null;
	}

}
